import { defineStore, acceptHMRUpdate } from 'pinia'
import { ref } from 'vue';
import { ktlbus } from '@/utils';

// 组合式 store
export const useTabbarStore = defineStore('tabbar', () => {
	
	
	const bus = ref(ktlbus.init());
	// 角色：2-教师，3-学生，4-家长，6-合伙人
	
	
	const tabbar = [
		{
			pagePath: "/pages/tabbar/home/home",
			iconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-home.png",
			selectedIconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-home-active.png",
			text: '首页',
			isDot: false,
			customIcon: false,
			roleIds: [2, 3, 4]
		},
		{
			pagePath: "/pages/tabbar/class/class",
			iconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-myclass.png",
			selectedIconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-myclass-active.png",
			text: '我的课程',
			isDot: false,
			customIcon: false,
			roleIds: [2, 3, 4]
		},
		{
			pagePath: "/pages/tabbar/review/reviewlist",
			iconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-mystudent.png",
			selectedIconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-mystudent-active.png",
			text: '自主复习',
			isDot: false,
			customIcon: false,
			roleIds: [3, 4]
		},
		{
			pagePath: "/pages/tabbar/me/me",
			iconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-me.png",
			selectedIconPath: "https://nx5.abc5g.com/h5/static/tabbar/tabbar-me-active.png",
			text: '我的',
			isDot: false,
			customIcon: false,
			roleIds: [2, 3, 4]
		}
	]
	
	return {
		bus,
		tabbar
	}
})
